Repository navigation
Create the draft release before electron-builder publishes - #6
Merged
Merged
Conversation
Parallel artifact publishers each found no release for the tag and each created one, which split v1.8.0's assets across two drafts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
v1.8.0 ended up with two draft releases: the log shows `creating GitHub release reason=release doesn't exist` twice, and the assets were split between them.
Cause (electron-builder / electron-publish 26.15.3, as installed): `PublishManager.getOrCreatePublisher` (app-builder-lib/out/publish/PublishManager.js:166) looks up the cache, then `await createPublisher(...)`, then sets the cache. Artifacts that finish together all miss the cache during that await and get separate `GitHubPublisher` instances. Each has its own lazy `_release`, so each runs `getOrCreateRelease()`, sees no release and calls `createRelease()`. With four targets now (dmg/zip × arm64/x64) this became likely.
Fix: a step before the build creates a draft for the pushed tag with `gh release create "$GITHUB_REF_NAME" --draft --verify-tag --title "${GITHUB_REF_NAME#v}"`, skipped if a release for the tag already exists, so re-runs are safe. Signing keychain steps are unchanged.
Why electron-builder reuses it (electron-publish/out/gitHubPublisher.js):
Not exercised with a real tag; it should be checked on the next release (expect no `creating GitHub release` line in the log and one draft).
🤖 Generated with Claude Code